<?php
   require_once('system/dbConnect.php');
   require_once('system/MyFunc.php');   
  connect();
  //使用$_POST数组获取表单中输入的数据
  $id = $_POST['id'];
 if(!empty($_FILES["pic"]["name"])){
  	$pic = uploadfile('pic','upload/',array('png','jpg','gif'));
  }
  else{
  	$pic=' ';
  }

  $data = array('typename' =>$_POST['typename'],);

		 $result = update('videotype',$data,'tid='.$id);
  if(!$result){
		echo "更新失败！<br/>";
		echo "<a href='vtlist.php'>返回</a>";	  
  }else{		
		redirect('vtlist.php', '更新成功！');
  }	   
 ?>